#!/usr/bin/env bash
if [ ! $1 ]
then
    array=(api account security post)
    for((i=0;i<${#array[@]};i++))
    do
        go build -o lab-${array[i]} cmd/${array[i]}.go
        if [ $? -eq 0 ]; then
            echo "${array[i]} 编译成功";
        else
            echo "${array[i]} 编译失败"
        fi
    done
else
    go build -o lab-$1 cmd/$1.go
    if [ $? -eq 0 ]; then
        echo "$1 编译成功";
    else
        echo "$1 编译失败"
    fi
fi

